package com.itheima.controller;

import com.itheima.common.constant.MessageConstant;
import com.itheima.common.entity.Result;
import com.itheima.pojo.LoginDTO;
import com.itheima.service.MemberService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController("mobileMemberController")
@RequestMapping("/member")

public class MemberController {
    @Autowired
    MemberService memberService;
    @PostMapping("/login")
    Result login(@RequestBody LoginDTO loginDTO){
        log.info("登录：{}", loginDTO);
        memberService.login(loginDTO);
        return  new Result(true, MessageConstant.LOGIN_SUCCESS);

    }

}
